<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>51预定管理后台 V0.1</title>
    <link rel="stylesheet" type="text/css" href="${base}/resources/themes/bootstrap/easyui.css">
	<link rel="stylesheet" type="text/css" href="${base}/resources/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="${base}/resources/demo.css">
	<script type="text/javascript" src="${base}/resources/jquery.min.js"></script>
    <script type="text/javascript" src="${base}/resources/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${base}/resources/locale/easyui-lang-zh_CN.js"></script>
    <script src="${base}/resources/jquery.mloading.js"></script>
    <link rel="stylesheet" href="${base}/resources/jquery.mloading.css">

    <style type="text/css">
	body{
		margin-right: 0px;
		padding: 0px;
	}
	.fm{
		border-style: solid;
		border-width: 1px;
		border-color: gray;
		padding: 5px;
	}
	.fm td{
		text-align: right;
	}
	.fm tr{
		border-bottom: 1px solid gray;
	}
	.label{
		display: block;
		margin-top: 7px;
		margin-bottom: 7px;
		color: grey;
	}
	.menu{
		list-style: none;
		width: 90%;
		border:1px hidden;
	}
	.menu li{
		text-align: center;
		height: 20px;
		line-height: 20px;
		margin-top: 3px;
        border: 1px solid black;
    }
    .menu li:hover{
		background-color: #428bca;
		border: 1px solid black;
    }
    .menu a{
		text-decoration: none;
		color:black;
		height: 100%;
		display: block;
		width: 100%;
	}
    .menu-li-selected{
        background-color: #428bca;
        border: 1px solid black;
        color:white;
    }
    #loading-mask{
        width: 100%;
        height: 100%;
        position: absolute;
        background-image: url(${base}/resources/images/loading.gif);
        background-repeat: no-repeat;
        background-color: #ffffff;
        background-position:center;
        background-attachment:fixed;
        z-index: 999;
    }
	</style>
	<script type="text/javascript">
	function initMenu(){
        //初始化菜单
		$.ajax({
			url:"${base}/management/modules",
			type:"GET",
			dataType:"json",
			async:false,
			success:function(data){
                if(data.length == 0){
                    $.messager.show({
                        title:'提示',
						msg:'未分配任何权限，请联系管理员'
                });
                }
                $.each(data,function(i,o){
                    var subMenu = "<ul class=\"menu\">";
                    $.each(o.child,function(i,o){
                    	subMenu += "<li id=\""+o.id+"\"><a href=\"#\" onclick=\"linkPage('"+o.id+"','"+o.linkPage+"','"+o.moduleName+"')\">"+o.moduleName+"</a></li>"
					});
					subMenu +="</ul>";
                    $('#aa').accordion('add',{
                        title: o.moduleName,
                        selected: false,
                       	 content:subMenu
                    });
                });
                setTimeout("loadingHide()",250);
            },
            error:function () {
                setTimeout("loadingHide()",250);
                $.messager.show({
                    title:'提示',
                    msg:'读取菜单失败，请联系管理人员'
                });
            }
		});
	}
	$(function(){
        hello();
        $("#tt").tabs(
                'add',{
                    title: '系统首页',
                    selected: true,
                    closable:false,
                    border:false,
                    content:"欢迎使用本系统",
                }
        );
        initMenu();
	});
    function onDblClickRow(index,row){
        $('#dl-detail').dialog("open");
    }
    var tempLi = undefined;
    function linkPage(id,linkPage,moduleName) {
        if (tempLi != undefined){
            tempLi.removeClass("menu-li-selected");
		}
        $("#"+id).addClass("menu-li-selected");
        tempLi = $("#"+id);
        if($("#tt").tabs('exists',moduleName)){
            $("#tt").tabs('select',moduleName);
            return;
		};
		$("#tt").tabs(
                'add',{
                    title: moduleName,
                    selected: true,
                    closable:true,
                    border:false,
                    content:"<iframe  scrolling=\"no\" src=\"${base}/management"+linkPage+"\" style=\"display: block;margin:0xp,padding:0px;width: 100%;height: 100%;border: 0px solid transparent;\"></iframe>",
                }
		);
    }
    function hello() {
        var $helloSpan = $("#hello");
        now = new Date(),hour = now.getHours()
        if(hour < 6){$helloSpan.text("凌晨好！")}
        else if (hour < 9){$helloSpan.text("早上好！")}
        else if (hour < 12){$helloSpan.text("上午好！")}
        else if (hour < 14){$helloSpan.text("中午好！")}
        else if (hour < 17){$helloSpan.text("下午好！")}
        else if (hour < 19){$helloSpan.text("傍晚好！")}
        else if (hour < 22){$helloSpan.text("晚上好！")}
        else {$helloSpan.text("夜里好！")}
    }
    function loadingHide(){
        $("#loading-mask").css("display","none");
    }
	</script>
</head>
<body class="easyui-layout">
<div id="loading-mask">
</div>
    <div data-options="region:'north',border:false" style="color: white;height:35px;background:#428bca;padding:10px">贵州都匀9Bang软件团队
    	<div style="float:right;margin-left:20px;text-align:left;width:200px"><span id="hello" style="color:white;"></span>
    	<a href="#" style="text-decoration:none;color:white;margin-left:1px;padding: 0px">${realname}</a><span>丨</span>
		<a href="#" style="text-decoration:none;color:white;">修改密码</a>
    	</div>
    </div>
    <div id="west" data-options="region:'west',split:true,title:'功能'" style="width:135px;overflow: hidden">
        <div id="aa" class="easyui-accordion easyui-accordion-noborder" data-options="animate:false" style="width:100%;height:100%;padding: 0px;margin: 0px;">

        </div>
    </div>
    <div data-options="region:'south',border:false" style="height:35px;background:#428bca;padding:10px;color: white;">51预定管理系统 1.0.0 beta</div>
    <div data-options="region:'center'" style="border: 0px solid black !important;">
        <div id="tt" class="easyui-tabs" style="width:100%;height:100%;">
 <#--           <div title="Tab1" style="padding:0px;display:none;overflow: hidden;">

                <iframe src="https://www.baidu.com" style="overflow: hidden;width: 100%;height: 100%;border: 0px solid transparent;"></iframe>


			</div>
            <div title="Tab2" data-options="closable:true" style="overflow:auto;padding:20px;display:none;">
                tab2
            </div>
            <div title="Tab3" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;display:none;">
                tab3
            </div>-->
        </div>
    </div>
</body>
</html>